package com.ruoyi.app.common;


import com.ruoyi.common.utils.DateUtils;

/**
 * Created by xiaoban on 2019/10/8.
 */
public class OrderNumUtil {
    private static SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker(0, 0);

    public static String getRandom() {
        return (snowflakeIdWorker.nextId() + "").substring(6,12);
    }

    public static String getOrderNum() {
        return DateUtils.dateTimeNow() +(snowflakeIdWorker.nextId() + "").substring(6,10);
    }
}
